package com.thread;

public class PrintString implements Runnable{
	private boolean isContinue = true;

	public boolean isContinue() {
		return isContinue;
	}

	public void setContinue(boolean isContinue) {
		this.isContinue = isContinue;
	}
	
	public void printStringMethod() {
		try {
			while(isContinue == true) {
				//System.out.println("12"); //！！！！关键
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) throws InterruptedException {
		PrintString ps = new PrintString();
		new Thread(ps).start();
		Thread.sleep(100);
		ps.isContinue = false;
		System.out.println("end main");
	}

	@Override
	public void run() {
		printStringMethod();
	}
}
